<template>
  <div>
    question 从video切换到question页面时，它们二个的生命周期执行先后
    question(beforeCreate)===>question(created)==>question(beforeMount)===>video(beforeDestroy)==>video(destroyed)==>question(mounted)
    <input type="text" />
  </div>
</template>

<script>
export default {
  beforeCreate () {},
  created () {
    let arr = [{ id: 1 }, { id: 2 }]
    let all = [{ id: 1 }, { iid: 2 }, { id: 3 }, { id: 4 }]
    const newArr = all.filter(item => {
      const isFind = arr.find(item2 => {
        return item2.id === item.id
      })
      return !isFind
    })
    console.log('newArr', newArr)
  },
  beforeMount () {},
  mounted () {}
}
</script>

<style></style>
